#include <QCoreApplication>
#include <qclog/qclog.h>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    ///[1]
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, "This is a debug 不好message.");
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, false);
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, '1');
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, 33333);
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, 15.9998);
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, QString("你好QString."));
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, QByteArray("QB你好yteArray."));

    QJsonObject obj;
    obj.insert("name", "飞666");
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, obj);

    ///[2]
    QcLog::set_console_level(QcLog::Level::WARNING);
    QcLog::info(__FILE__, __LINE__, __FUNCTION__, "info111");
    QcLog::debug(__FILE__, __LINE__, __FUNCTION__, "debug111");
    QcLog::warning(__FILE__, __LINE__, __FUNCTION__, "warning111");
    QcLog::critical(__FILE__, __LINE__, __FUNCTION__, "critical111");
    QcLog::fatal(__FILE__, __LINE__, __FUNCTION__, "fatal111");



    ///[3]
    QCLOG_SET_CONSOLE_LEVEL(QcLog::Level::INFO);
    QCLOG_INFO("info222");
    QCLOG_DEBUG("debug222");
    QCLOG_WARNING("warning222");
    QCLOG_CRITICAL("critical222");
    QCLOG_FATAL("fatal222");


    ///[4]
    qDebug() << "AAAAAAAAAAAAAAAAAAAAA";
    qDebug() << "BBBBBBBBBBBBBBBBBBBBB";
    QCLOG_SET_HIJACK_QDEBUG(true);
    qDebug() << "CCCCCCCCCCCCCCCCCCCCCCCC";
    qDebug() << "DDDDDDDDDDDDDDDDDDDDDDD";

    return a.exec();
}
